<%--
    Document   : MetricsCalculation
    Created on : Jun 16, 2011, 9:22:02 PM
    Author     : Tin Huynh
--%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.HashMap"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
    String resultMessage = (String) request.getAttribute("resultMessage");
    HashMap confPaperCountHashMap = (HashMap) request.getAttribute("confPaperCountHashMap");
    HashMap jourPaperCountHashMap = (HashMap) request.getAttribute("jourPaperCountHashMap");
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Metrics Calculation</title>
    </head>
    <body>
        <h1><font><center>Metrics Calculation</center></font></h1>
        <%  if ((resultMessage != null) && (!resultMessage.equals(""))) {
        %>
        <font color="red"><%=resultMessage%></font><br>
        <%
        }
        %>
        <a href="./GoIndexPageServlet">Home</a>&nbsp;&nbsp;&nbsp;
        <a href="./GoBibliographyDBBuildingServlet">Build & Enrich CS Publications Bibliography DB</a>&nbsp;&nbsp;&nbsp;
        <a href="./GoCoAuthorGraphBuildingServlet">Build Co-Author Network</a>&nbsp;&nbsp;&nbsp;
        <a href="./GoProgramCommiteeNetworkBuildingServlet">Build CoAuthor NetWork for Program-Committee</a>&nbsp;&nbsp;&nbsp;
        <hr width="100%" size=10 color="blue">
        <a href="./CalculateTotalConferenceServlet">Metric #1: Total of papers in conferences</a><br>
        <a href="./CalculateTotalConferencePercentageServlet">Metric #2: Percent of papers in conferences</a><br>
        <a href="./CalculateTotalConfPercentWithCoAuthorServlet">Metric #3: Total Conf percentage with co-authored</a><br>
        <a href="./CalculateNetworkDistanceServlet">Metric #4: Network distances with the program committee network</a><br>
        <a href="#">...</a><br>
        <br>
        <b>Metric #1: Total of papers in conferences</b>
        <table bordercolor="blue" border="1" width="100%">
        <tr bgcolor="#EBEBEB">
            <td width="5%"><b>No.</b></td>
            <td width="50%"><b>Conference name</b></td>
            <td width="45%"><b>Total papers</b></td>
        </tr>
        <%
        if (confPaperCountHashMap != null && confPaperCountHashMap.size() > 0) {
            Set confPaperSet = confPaperCountHashMap.entrySet();
            Iterator confIter = confPaperSet.iterator();
            int order = 1;
            while(confIter.hasNext()){
                Map.Entry confPaperMapEntry = (Map.Entry)confIter.next();
        %>
            <tr>
                <td><%=order%></td>
                <td><%=confPaperMapEntry.getKey()%></td>
                <td><%=confPaperMapEntry.getValue()%></td>
            </tr>
        <%
                order++;
            }
        }
        %>

        </table>
        <table bordercolor="blue" border="1" width="100%">
        <tr bgcolor="#EBEBEB">
            <td width="5%"><b>No.</b></td>
            <td width="50%"><b>Journal name</b></td>
            <td width="45%"><b>Total papers</b></td>
        </tr>
        <%
        if (jourPaperCountHashMap != null && jourPaperCountHashMap.size() > 0) {
            Set jourPaperSet = jourPaperCountHashMap.entrySet();
            Iterator jourPaperIter = jourPaperSet.iterator();
            int order = 1;
            while(jourPaperIter.hasNext()){
                Map.Entry jourPaperMapEntry = (Map.Entry)jourPaperIter.next();
        %>
            <tr>
                <td><%=order%></td>
                <td><%=jourPaperMapEntry.getKey()%></td>
                <td><%=jourPaperMapEntry.getValue()%></td>
            </tr>
        <%
                order++;
            }
        }
        %>
        </table>
    </body>
</html>
